import Vue from 'vue'
import Router from 'vue-router'
import home from '@/view/home'
import rank from '@/view/rank'
import list from '@/view/list'
import singer from '@/view/singer'
import search from '@/view/search'

import nav from '@/components/navbar'
import searchbar from '@/components/searchbar'

Vue.use(Router)

export let routes = [
    {
      path: '/',
      name: 'home',
      title: '新歌',
      components: {
         bar:nav,
         default: home
      }
    },
    {
      path: '/rank',
      name: 'rank',
      title: '排行',
      components: {
        bar:nav,
        default: rank
      }
    },
    {
      path: '/list',
      name: 'list',
      title: '歌单',
      components: {
        bar:nav,
        default: list
      }
    },
    {
      path: '/singer',
      name: 'singer',
      title: '歌手',
      components: {
        bar:nav,
        default:singer
      }
    },
    {
      path: '/search',
      name: 'search',
      title: '搜索',
      components: {
        bar:searchbar,
        default: search
      }
    }

]

export default new Router({
    routes
})

